import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'RotatedBox Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: RotatedBoxDemo(),
    );
  }
}

class RotatedBoxDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('RotatedBox Demo'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // 使用 RotatedBox 来旋转 Container
            RotatedBox(
              quarterTurns: 1, // 旋转90度，即1/4圈
              child: Container(
                width: 200,
                height: 100,
                color: Colors.blue,
                child: Center(
                  child: Text(
                    'Rotated Box',
                    style: TextStyle(color: Colors.white, fontSize: 20),
                  ),
                ),
              ),
            ),
            SizedBox(height: 20),
            RotatedBox(
              quarterTurns: 2, // 旋转180度，即2/4圈
              child: Container(
                width: 200,
                height: 100,
                color: Colors.green,
                child: Center(
                  child: Text(
                    'Rotated Box 180°',
                    style: TextStyle(color: Colors.white, fontSize: 20),
                  ),
                ),
              ),
            ),
            SizedBox(height: 20),
            RotatedBox(
              quarterTurns: 3, // 旋转270度，即3/4圈
              child: Container(
                width: 200,
                height: 100,
                color: Colors.red,
                child: Center(
                  child: Text(
                    'Rotated Box 270°',
                    style: TextStyle(color: Colors.white, fontSize: 20),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
